import request from "@/utils/request";

export function pageList(page, limit) {
  return request({
    //baseURL: "http://localhost:8004",
    url: `/admin/cms/ad/list/${page}/${limit}`,
    method: "get"
  });
}

export function removeById(id) {
  return request({
    //baseURL: "http://localhost:8004",
    url: `/admin/cms/ad/remove/${id}`,
    method: "delete"
  });
}

export function save(ad) {
  return request({
    //baseURL: "http://localhost:8004",
    url: "/admin/cms/ad/save",
    method: "post",
    data: ad
  });
}

export function getById(id) {
  return request({
    //baseURL: "http://localhost:8004",
    url: `/admin/cms/ad/get/${id}`,
    method: "get"
  });
}

export function updateById(ad) {
  return request({
    //baseURL: "http://localhost:8004",
    url: "/admin/cms/ad/update",
    method: "put",
    data: ad
  });
}
